package cn.fantasy.reflect;

import com.sun.org.apache.bcel.internal.generic.LoadClass;

import java.lang.reflect.Field;

/**
 * @author ET
 * @description TODO
 * @date 2023/5/13 18:13
 * @Version V1.0
 */
public class ReflectMode {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InstantiationException {
        Class<Person> personClass = Person.class;

        Person person1 = personClass.newInstance();

        person1.setName("张良");
        System.out.println(person1.toString());


        Person person = new Person();
        Class<? extends Person> aClass = person.getClass();

        Class<?> aClass1 = Class.forName("cn.fantasy.reflect.Person");

        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        systemClassLoader.loadClass("cn.fantasy.reflect.Person");

    }
}
